<?php

namespace app\controller\system;

use app\BaseController;
use think\response\Json;

class Tip extends BaseController
{
    public function save(): Json
    {
        return $this->handle(function () {
            return $this->app->make(\app\model\Tips::class)->saveData();
        });
    }

    public function tip_lst(): Json
    {
        return $this->handle(function () {
            return $this->app->make(\app\model\Tips::class)->pageData();
        });
    }

    public function detail(): Json
    {
        return $this->handle(function () {
            return $this->app->make(\app\model\Tips::class)->where('id', $this->request->param('id'))->find();
        });
    }

    public function delete()
    {
        return $this->handle(function () {
            $this->app->make(\app\model\Tips::class)->where('id', $this->request->param('id'))->delete();
        });
    }
}
